package com.wangsd.web.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wangsd.web.sys.entity.SysRole;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author generator
 * @since 2019-09-02
 */
public interface SysRoleMapper extends BaseMapper<SysRole> {

    @Select("SELECT * FROM sys_role t LEFT JOIN sys_user_role t2 ON t.id = t2.role_id WHERE t2.user_id = #{userId}")
    List<SysRole> selectByUserId(Long userId);

}
